from appium.webdriver.common.appiumby import AppiumBy
from base.add_cart_base import AddCartBase
from appium.webdriver import Remote


class AddCartPage(AddCartBase):
    def add_product_click(self,driver):
        read_product_info_xpath=self.add_product()
        return self.click_new(driver,AppiumBy.XPATH,read_product_info_xpath)

    def select_product_click(self,driver):
        select_product_xpath=self.select_product()
        return self.click_new(driver,AppiumBy.XPATH,select_product_xpath)

    def sure_product_click(self, driver):
        sure_product_xpath = self.sure_product()
        return self.click_new(driver, AppiumBy.XPATH, sure_product_xpath)

    def add_shopping_cart(self,driver:Remote):
        self.add_product_click(driver)
        self.select_product_click(driver)
        self.sure_product_click(driver)